// pages/news-details/news-details.js
Page({
  data: {
    flag:0
  },

  onLoad: function (options) {
    wx.showLoading({
      title: '加载中...',
    })
    let notice_id = options.notice_id
    let access_token = wx.getStorageSync('access_token')
    wx.request({
      url: 'https://baokang.wshoto.com/wx/noticedetail',
      data:{
        access_token:access_token,
        notice_id:notice_id
      },
      success:(res)=>{
        console.log(res)
        if(res.data.code >= 500){
          app.getLogin().then(function(){
            console.log('二次登录。。。')
          })
        } 
        else if(res.data.code == 1){
          this.setData({
            title:res.data.info.title,
            date:res.data.info.create_date,
            content:res.data.info.content,
            flag:1
          })
        }
      },
      complete:(res)=>{
        wx.hideLoading()
      }
    })
    
  },
  
})



